package com.sky.mapper;

import com.sky.dto.UserLoginDTO;
import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据openId查询用户
     * @param openId
     * @return
     */
    @Select("select * from user where openid =#{openId}")
    User getOpenId(String openId);


    void insert(User user);

    @Select("select * from user where id=#{userId}")
    User getById(Long userId);

    //所有用户
    Double countByMap(Map map);

    Integer newCountByMap(Map map);
}
